package coderead.plugin.ui.settings;


import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.util.xmlb.XmlSerializerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@State(name = "cn.MavenSearchSettings", storages = {@Storage("MavenSearchSettings.xml")})
public class SettingPersistent implements PersistentStateComponent<SettingInfo> {

    @Nullable
    @Override
    public SettingInfo getState() {
        return SettingInfo.getInstance();
    }

    @Override
    public void loadState(@NotNull SettingInfo settingInfo) {
        XmlSerializerUtil.copyBean(settingInfo, SettingInfo.getInstance());
    }
}
